package com.Multi_threaded;
/**
 * 继承多线程二：实现Runnable接口(用匿名内部类)
 */
public class Test5 {
    public static void main(String[] args) {
        Runnable target=new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println("子线程一："+i);
                }
            }
        };
        new Thread(target).start();
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 5; i++) {
                    System.out.println("子线程2："+i);
                }
            }
        }).start();
        for (int i = 0; i < 5; i++) {
            System.out.println("线程"+i);
        }

    }
}
